#ifndef CLIENTHANDLER_H_
#define CLIENTHANDLER_H_

#include <queue>
#include <cstdlib>

#include "../util/Configuration.h"
#include "../repository/UserProfileManager.h"
#include "../recommender/CollaborativeFilter.h"
#include "../recommender/E_CFAlgorithm.h"

using namespace std;

class ClientHandler {
private:
	pthread_mutex_t ch_mutex;
	queue<string> request_messages;
	queue<string> response_messages;
	UserProfileManager* userProfileManager;
	CollaborativeFilter cf;
	const char request_tk;
	const char separator_tk;

public:
	ClientHandler();
	~ClientHandler();

	vector<string> parse_request(string& message);
	string parse_response(vector<string> message);
	void push_request(string& message);
	string pop_response();
	void proccess_requests();
};

#endif /* CLIENTHANDLER_H_ */
